import { createRouter, createWebHistory } from 'vue-router'
import {TrendCharts, List, Grid,} from '@element-plus/icons-vue'

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: '/',
      redirect:'/admin'
    },
    {
      path: '/admin',
      component: () => import('../views/Admin.vue'),
      children: [
        {
          path: '/admin/dashboard',
          component: () => import('../views/Dashboard/Dashboard.vue'),
          meta: {
            title: '仪表台',
            icon: TrendCharts
          }
        },
        {
          path: '/admin/user',
          component: () => import('../views/Users/User.vue'),
          meta: {
            title: '用户管理',
            icon: Grid
          }
        }
      ]
    }
  ]
})

export default router
